package agend.client.gui.utils;

import jade.gui.GuiAgent;

import javax.swing.JFrame;
import javax.swing.JPanel;


import agend.client.gui.ClientGui;
import agend.client.gui.panels.LoginPanel;
import agend.client.gui.panels.MenuPanel;

public class HandlerView {

	private static final JFrame frame = new ClientGui();
	
	private static Broker broker = new Broker();
	
	private static JPanel loginPanel = new LoginPanel();
	private static MenuPanel menuPanel = new MenuPanel();
	
	private static GuiAgent agent;
	
	public static void setLoginPanel()
	{
		frame.setContentPane(loginPanel);
	}
	
	public static void setMenuPanel()
	{
		frame.setContentPane(menuPanel);
	}
	
	public static void update()
	{
		frame.validate();
		frame.repaint();
	}
	
	public static void setVisible(boolean b)
	{
		frame.setVisible(b);
	}
	
	public static void dispose()
	{
		frame.dispose();
	}

	public static JFrame getFrame() {
		return frame;
	}

	public static JPanel getLoginpanel() {
		return loginPanel;
	}

	public static MenuPanel getMenupanel() {
		return menuPanel;
	}

	public static Broker getBroker() {
		return broker;
	}

	public static GuiAgent getAgent() {
		return agent;
	}

	public static void setAgent(GuiAgent agent) {
		HandlerView.agent = agent;
	}
	
}
